<?php

namespace app\common\validate;

use think\Validate;

class Common extends Validate
{
    protected $rule = [
        "mobile" => "require|unique:member",
        "nickname" => "require",
        "password" => "require",
        "pay_password" => "require",
        'RefereeCode' => "require",
        "id_card" => "require|unique:member",
        "total" => "require",
        "bank_name" => "require",
        "bank_account" => "require",
        "bank_number" => "require",
        "name" => "require",
        "phone" => "require",
        "prov_id" => "require",
        "city_id" => "require",
        "county_id" => "require",
        "details" => "require",
        "old_p" => "require",
        "new_p" => "require",
        "re_p" => "require",
        "title" => "require",
        "content" => "require",
        "usdt" => "require",

        "img" => "require",
        '__token__' => 'require|token',

    ];

    protected $message = [
        'mobile.require' => '请输入手机号',
        'mobile.unique' => '手机号已被注册',
        'nickname.require' => '请输入姓名',
        'password.require' => '请输入登录密码',
        'pay_password.require' => '请输入支付密码',
        'RefereeCode.require' => '请输入推荐人手机号',
        'id_card.require' => '请输入身份证号',
        'id_card.unique' => '身份证号已被使用',
        'total.require' => '请输入要提现的金额',
        'bank_name.require' => '请输入银行名称',
        'bank_account.require' => '请输入银行户名',
        'bank_number.require' => '请输入银行账号',
        'name.require' => '请输入收货人姓名',
        'phone.require' => '请输入收货电话',
        'prov_id.require' => '请选择省份',
        'city_id.require' => '请选择市',
        'county_id.require' => '请选择区县',
        'details.require' => '请输入详细地址',
        'old_p.require' => '请输入原密码',
        'new_p.require' => '请输入新密码',
        're_p.require' => '请确认新密码',
        'title.require' => '请输入标题',
        'content.require' => '请输入内容',
        'img.require' => '请上传收款码',
        'usdt.require' => '请填写地址',

        '__token__.require' => '提交失败',
        '__token__.token' => '请勿重复提交',
    ];
    protected $scene = [
        "register" => ["mobile", "nickname", "password", "pay_password", "referee_code"],
        "login" => ["mobile", "pay_password", "__token__"],
        "vip" => ["id_card"],
        "address" => ["name", "phone", "prov_id", "city_id","details"],
        "draw" => ["total", "bank_name", "bank_account", "bank_number", "pay_password"],
        "save_password" => ["old_p", "new_p", "re_p"],
        "complaint" => ["title", "content"],
        "bank" => ["bank_name", "bank_account", "bank_number", ],
        "img" => ["img"],
        "usdt" => ["usdt_addr"],

    ];
}